home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-18 | 1.7 KB | 149 lines | [TEXT/R*ch] |
- // (c) copyright 1995,1996, Jon Kalb, Liberty Software
- // Kalb@LibertySoft.com
- // You may freely incorporate this code into any machine-
- // readable project. You may modify this code, but you may
- // not remove this statement.
-
- #include "doututils.h"
-
- ostream &showflags(ostream &stream)
- {
- long f;
-
- f = stream.flags(); // get flag settings
-
- if (ios::skipws & f)
- {
- stream << "SKIPWS ";
- }
- else
- {
- stream << "skipws ";
-
- }
-
- if (ios::left & f)
- {
- stream << "LEFT ";
- }
- else
- {
- stream << "left ";
- }
-
- if (ios::right & f)
- {
- stream << "RIGHT ";
- }
- else
- {
- stream << "right ";
- }
-
- if (ios::internal & f)
- {
- stream << "INTERNAL ";
- }
- else
- {
- stream << "internal ";
- }
- stream << endl;
-
- if (ios::dec & f)
- {
- stream << "DEC ";
- }
- else
- {
- stream << "dec ";
- }
-
- if (ios::oct & f)
- {
- stream << "OCT ";
- }
- else
- {
- stream << "oct ";
- }
-
- if (ios::hex & f)
- {
- stream << "HEX ";
- }
- else
- {
- stream << "hex ";
- }
-
- if (ios::showbase & f)
- {
- stream << "SHOWBASE ";
- }
- else
- {
- stream << "showbase ";
- }
- stream << endl;
-
- if (ios::showpoint & f)
- {
- stream << "SHOWPOINT ";
- }
- else
- {
- stream << "showpoint ";
- }
-
- if (ios::uppercase & f)
- {
- stream << "UPPERCASE ";
- }
- else
- {
- stream << "uppercase ";
- }
-
- if (ios::showpos & f)
- {
- stream << "SHOWPOS ";
- }
- else
- {
- stream << "showpos ";
- }
-
- if (ios::scientific & f)
- {
- stream << "SCIENTIFIC ";
- }
- else
- {
- stream << "scientific ";
- }
- stream << endl;
-
- if (ios::fixed & f)
- {
- stream << "FIXED ";
- }
- else
- {
- stream << "fixed ";
- }
-
- if (ios::unitbuf & f)
- {
- stream << "UNITBUF ";
- }
- else
- {
- stream << "unitbuf ";
- }
- stream << endl;
-
- return stream;
- }
-
-